package com.ruoyi.produce.material.domain;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.utils.StringUtils;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;
import java.sql.Timestamp;
import java.util.List;

/**
 * 领/补/退料表
 * produce_material_requisition
 * @author Drj 2021/6/28
 */
public class ProduceMaterialRequisition extends BaseEntity {
    /**
     * 领料/补料/退料单编号
     */
    @NotNull(message = "领料/补料/退料单编号不能为空")
    @ApiModelProperty(value = "领料/补料/退料单编号", required = true)
    private String materialRequisitionId;
    /**
     * 加工单编号/委外生产计划编号
     */
    @NotNull(message = "加工单编号/委外生产计划编号不能为空")
    @ApiModelProperty(value = "加工单编号/委外生产计划编号", required = true)
    private String workSheetId;
    /**
     * 单据类型
     * 1:领料 2:补料 3:退料
     */
    private String materialRequisitionType;
    /**
     * 来源类型
     * 1:加工单，2:委外生产计划
     */
    private String sourceType;
//    /**
//     * 仓库编号
//     */
//    @NotNull(message = "仓库编号不能为空")
//    @ApiModelProperty(value = "仓库编号", required = true)
//    private String warehouseId;
//    /**
//     * 仓库名称
//     */
//    private String warehouseName;
    /**
     * 领料者编号
     */
    @NotNull(message = "领料者编号不能为空")
    @ApiModelProperty(value = "领料者编号", required = true)
    private String staffPickingId;
    /**
     * 领料者名称
     */
    private String staffPickingName;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp createTime;
    /**
     * 备注
     */
    private String remark;
    /**
     * 是否审批
     */
    @ApiModelProperty("是否审批")
    private String approvalFlag;
    /**
     * 领/补/退料详细表
     */
    private List<ProduceMaterialRequisitionList> produceMaterialRequisitionLists;

    public List<ProduceMaterialRequisitionList> getProduceMaterialRequisitionLists() {
        return produceMaterialRequisitionLists;
    }

    public void setProduceMaterialRequisitionLists(List<ProduceMaterialRequisitionList> produceMaterialRequisitionLists) {
        this.produceMaterialRequisitionLists = produceMaterialRequisitionLists;
    }

    @Override
    public String toString() {
        return "ProduceMaterialRequisition{" +
                "materialRequisitionId='" + materialRequisitionId + '\'' +
                ", workSheetId='" + workSheetId + '\'' +
                ", materialRequisitionType='" + materialRequisitionType + '\'' +
                ", sourceType='" + sourceType + '\'' +
                ", staffPickingId='" + staffPickingId + '\'' +
                ", staffPickingName='" + staffPickingName + '\'' +
                ", createTime=" + createTime +
                ", remark='" + remark + '\'' +
                ", approvalFlag='" + approvalFlag + '\'' +
                ", produceMaterialRequisitionLists=" + produceMaterialRequisitionLists +
                '}';
    }

    public String getMaterialRequisitionId() {
        return materialRequisitionId;
    }

    public void setMaterialRequisitionId(String materialRequisitionId) {
        this.materialRequisitionId = materialRequisitionId;
    }

    public String getApprovalFlag() {
        return approvalFlag;
    }

    public void setApprovalFlag(String approvalFlag) {
        this.approvalFlag = approvalFlag;
    }

    public String getWorkSheetId() {
        return workSheetId;
    }

    public void setWorkSheetId(String workSheetId) {
        this.workSheetId = workSheetId;
    }

    public String getMaterialRequisitionType() {
        return materialRequisitionType;
    }

    public void setMaterialRequisitionType(String materialRequisitionType) {
        this.materialRequisitionType = materialRequisitionType;
    }

    public String getSourceType() {
//        if (StringUtils.isNull(sourceType)) {
//            return "加工单";
//        } else {
//            if (sourceType.equals("加工单")) {
//                sourceType = "1";
//            } else if (sourceType.equals("委外生产计划")) {
//                sourceType = "2";
//            }
//        }
        return sourceType;
    }

    public void setSourceType(String sourceType) {
        this.sourceType = sourceType;
    }

//    public String getWarehouseId() {
//        return warehouseId;
//    }
//
//    public void setWarehouseId(String warehouseId) {
//        this.warehouseId = warehouseId;
//    }
//
//    public String getWarehouseName() {
//        return warehouseName;
//    }
//
//    public void setWarehouseName(String warehouseName) {
//        this.warehouseName = warehouseName;
//    }

    public String getStaffPickingId() {
        return staffPickingId;
    }

    public void setStaffPickingId(String staffPickingId) {
        this.staffPickingId = staffPickingId;
    }

    public String getStaffPickingName() {
        return staffPickingName;
    }

    public void setStaffPickingName(String staffPickingName) {
        this.staffPickingName = staffPickingName;
    }

    @Override
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Override
    public String getRemark() {
        return remark;
    }

    @Override
    public void setRemark(String remark) {
        this.remark = remark;
    }
}
